import request from '@/utils/request'

// 查询员工管理列表
export function pageEmployee(query) {
  return request({
    url: '/employee/employee/pageemployee',
    method: 'post',
    data: query
  })
}

//添加员工信息
export function addEmployee(data) {
  return request({
    url:'/employee/employee/addemployee',
    method: 'post',
    data: data
  })
}

//查询单个员工所有信息，进行修改
export function getEmployeeById(id) {
  return request({
    url: '/employee/employee/getEmployeeById/'+ id ,
    method: 'get'
  })
}

//修改员工所有信息
export function updateEmployee(data) {
  return request({
    url: '/employee/employee/updateEmployee/',
    method: 'post',
    data: data
  })
}

//修改员工状态/启用/停用
export function blockupEmployee(data) {
  return request({
    url: '/employee/employee/blockupemployee',
    method: 'post',
    data: data
  })
}

//删除员工和其他信息
export function deleteEmployee(employeeId) {
  return request({
    url: '/employee/employee/deleteEmployee/' + employeeId,
    method: 'get'
  })
}


//员工详情信息
export function contentEmployee(employeeId) {
  return request({
    url: '/employee/employee/getEmployeeById/'+ employeeId ,
    method: 'get'
  })
}
// // 新增员工管理
// export function addEmployee2(data) {
//   return request({
//     url: '/cs/employee',
//     method: 'post',
//     data: data
//   })
// }

// // 修改员工管理
// export function updateEmployee(data) {
//   return request({
//     url: '/cs/employee',
//     method: 'put',
//     data: data
//   })
// }

// 删除员工管理
export function delEmployee(id) {
  return request({
    url: '/cs/employee/' + id,
    method: 'delete'
  })
}
